package com.example.yuan0604;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.yml.R;

public class Main5Activity extends AppCompatActivity implements View.OnClickListener {

    private Button butt;
    public static final String ACTION = "com.example.yuan0604.Main5Activity";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main5);
        initView();
    }

    private void initView() {
        butt = (Button) findViewById(R.id.butt);

        butt.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.butt:
                Intent intent = new Intent();
                intent.setAction(ACTION);
                intent.putExtra("data", "lenovo");
                sendOrderedBroadcast(intent, null);
                break;
        }
    }
}
